<template>
    <div class="container p-5 shadow border border-1">
        <div class="form-group">
            <label for="">账号：</label>
            <input type="text" class="form-control" v-model="userInfo.acc" name="" placeholder="">
        </div>
        <div class="form-group">
            <label for="">密码：</label>
            <input type="password" class="form-control" v-model="userInfo.pwd" name="" placeholder="">
        </div>
        <button type="button" class="btn btn-success mt-3" @click="handler">登录</button>
    </div>
</template>

<script setup>
import { ref } from "vue";
import { useRoute, useRouter } from "vue-router";

const route = useRoute();
const router = useRouter();

const userInfo = ref({
    acc:'',
    pwd:''
})


const handler = e =>{
    // console.log(JSON.stringify(userInfo.value));
    sessionStorage.setItem('userInfo',JSON.stringify(userInfo.value))
    router.replace('/home')
}

</script>

<style lang="scss" scoped></style>